<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>下面代码执行完后打印的是?并说明原因</title>
</head>
<body>
  <script>
    const obj = {
      id: 123,
      age: 20,
      name: "cyrus",
      school: "河北科技大学"
    }
    let obj1 = {
      age: 18,
      ...obj,
      name: "李四"
    }
    /* 将obj1里面的obj进行遍历后得到
      let obj1 = {
        age: 18,
        id: 123,
        age: 20,
        name: "cyrus",
        school: "河北科技大学",
        name: "李四"
      }
      因为js特点相同的名字会从下往上进行覆盖
    */
    console.log(obj1.age)
    console.log(obj1.id)
    console.log(obj1.name)
  </script>
</body>
</html>